/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.maven1.mavenproject1spring1;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 *
 * @author Educacionit
 */
@Component
public class A implements InitializingBean{

    @Autowired
    private B b;
    private String codigo;


    public void imprimirPorConsola(){
        System.out.println("/*************************************/");
        System.out.println("        Metodo de la Clase A           ");
        System.out.println("/*************************************/");
    }
    
    /**
     * @return the b
     */
    public B getB() {
        return b;
    }

    /**
     * @param b the b to set
     */
    public void setB(B b) {
        this.b = b;
    }

    /**
     * @return the codigo
     */
    public String getCodigo() {
        return codigo;
    }

    /**
     * @param codigo the codigo to set
     */
    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public void afterPropertiesSet() throws Exception {
        b.imprimirPorPantalla();
    }
}
